export const UPDATE_KEYS = 'UPDATE_KEYS';
export const FETCH_KEYS = 'FETCH_KEYS';
export const CHECK_KEY = 'CHECK_KEY';
export const UNCHECK_KEY = 'UNCHECK_KEY';
export const UPDATE_KEY_METADATA = 'UPDATE_KEY_METADATA';

export function updateKeyMetada( metadata) {
  return {
    type: UPDATE_KEY_METADATA,
    payload: {
      metadata: metadata
    }
  };
}

export function updateKeys(keys, prefix) {
  return {
    type: UPDATE_KEYS,
    payload: {
      s3keys: keys,
      prefix: prefix
    }
  };
}

export function fetchKeys() {
  return {
    type: FETCH_KEYS
  };
}

export function checkKey(keys) {
  return {
    type: CHECK_KEY,
    payload: {
      keys: [...keys]
    }
  };
}

export function uncheckKey(keys) {
  return {
    type: UNCHECK_KEY,
    payload: {
      keys: [...keys]
    }
  };
}
